Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix composite key computation for BytesIO #388

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

janbrummer
Copy link
Contributor

In case a keyfile as BytesIO has been read before, the next read will be empty. We need to ensure that we are reading the data from the beginning.

Add seek to start to fix it.

@A6GibKm
Copy link
Contributor

A6GibKm commented Mar 26, 2024

Please add a test to showcase how this can corrupt a db and that it does not happen with this patch.

@janbrummer
Copy link
Contributor Author

Please add a test to showcase how this can corrupt a db and that it does not happen with this patch.

Could you take this one over? I do have some higher priority stuff on my stack and this blocks Secrets.

@A6GibKm
Copy link
Contributor

A6GibKm commented Mar 26, 2024

Please add a test to showcase how this can corrupt a db and that it does not happen with this patch.

Could you take this one over? I do have some higher priority stuff on my stack and this blocks Secrets.

Sure, thanks for looking into it!! Make sure I am able to push to this branch.

@A6GibKm A6GibKm force-pushed the fix-composite-write branch from 8698fdc to 79dbb28 Compare March 26, 2024 17:47
@A6GibKm
Copy link
Contributor

A6GibKm commented Mar 26, 2024

@Evidlo Hi, this is ready for review. For context, this is corrupting databases on Secrets https://gitlab.gnome.org/World/secrets/-/issues/537.

tests/tests.py Show resolved Hide resolved
@janbrummer janbrummer force-pushed the fix-composite-write branch from 79dbb28 to 839508c Compare April 3, 2024 19:05
In case a keyfile as BytesIO has been read before, the
next read will be empty. We need to ensure that we
are reading the data from the beginning.

Add seek to start to fix it.
@janbrummer janbrummer force-pushed the fix-composite-write branch from 839508c to ac2653a Compare April 3, 2024 19:17
@Evidlo Evidlo merged commit 6e591b4 into libkeepass:master Apr 9, 2024
5 of 6 checks passed
A6GibKm added a commit to flathub/org.gnome.World.Secrets that referenced this pull request Apr 11, 2024
We also update the patch with commit actually merged as part of
libkeepass/pykeepass#388.
A6GibKm added a commit to flathub/org.gnome.World.Secrets that referenced this pull request Apr 12, 2024
We also update the patch with commit actually merged as part of
libkeepass/pykeepass#388.
A6GibKm added a commit to flathub/org.gnome.World.Secrets that referenced this pull request Apr 12, 2024
We also update the patch with commit actually merged as part of
libkeepass/pykeepass#388.
A6GibKm added a commit to flathub/org.gnome.World.Secrets that referenced this pull request Apr 12, 2024
We also update the patch with commit actually merged as part of
libkeepass/pykeepass#388.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants